Skip to content

ext/session: code cleanup and minor refactoring#21467

Merged
Girgias merged 6 commits intophp:masterfrom
thg2k:pr/session_cleanup_1
Mar 19, 2026
Merged

ext/session: code cleanup and minor refactoring#21467
Girgias merged 6 commits intophp:masterfrom
thg2k:pr/session_cleanup_1

Conversation

@thg2k
Copy link
Contributor

@thg2k thg2k commented Mar 18, 2026

No description provided.

@Girgias
Copy link
Member

Girgias commented Mar 18, 2026

CI is failling but I'm in favour of those consistency fixes. I was recently again looking at setting up clang format and clang tidy on an individual extension basis.

@thg2k
Copy link
Contributor Author

thg2k commented Mar 18, 2026

CI is failling

My bad, I redid the changes from a local branch and did not test it. I'll fix it right away!

@thg2k thg2k force-pushed the pr/session_cleanup_1 branch from 9d133e0 to 355d08a Compare March 18, 2026 13:34
@thg2k
Copy link
Contributor Author

thg2k commented Mar 18, 2026

@Girgias CI is green, please let me know if you manage to review it, in particular the changes to OnUpdateSidBits and OnUpdateSessionGcProbability.

I find the strategy to return early on failure and leave the success case for last to be much more readable, if you are in favor I have more like that to submit.

Also how do you stand on the space after cast? (int)foo => (int) foo

php_session_remove_cookie(); /* remove already sent session ID cookie */
/* 'replace' must be 0 here, else a previous Set-Cookie
header, probably sent with setcookie() will be replaced! */
/* 'replace' must be 0 here, else a previous Set-Cookie
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe fix the 0 to false either in the future?

@Girgias
Copy link
Member

Girgias commented Mar 19, 2026

@Girgias CI is green, please let me know if you manage to review it, in particular the changes to OnUpdateSidBits and OnUpdateSessionGcProbability.

I find the strategy to return early on failure and leave the success case for last to be much more readable, if you are in favor I have more like that to submit.

Agreed

Also how do you stand on the space after cast? (int)foo => (int) foo

I'm not sure if I have that much of a preference, I wonder what the majority of other extensions do and maybe try to converge to that? It would be nice to properly have some consistent styles across the codebase in the long run.

@Girgias Girgias merged commit 103e35d into php:master Mar 19, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants